Skip to content

Conversation

@HangyuanLiu
Copy link
Contributor

@HangyuanLiu HangyuanLiu commented May 25, 2020

This commit mainly supports load bitmap_union, hll_union, and count materialized views.

The main changes are as follows:
1、insert stmt support load extend column
2、load stmt support load extend column

Issue : #3344

@HangyuanLiu HangyuanLiu self-assigned this May 25, 2020
@HangyuanLiu HangyuanLiu added area/materialized-view Issues or PRs related to materialized view kind/feature Categorizes issue or PR as related to a new feature. labels May 25, 2020
@HangyuanLiu HangyuanLiu changed the title [WIP] Support materialized view load and insert Support materialized view load and insert Jun 6, 2020
}
// The extension column of the materialized view is added to the expression evaluation of load
for (Column column : tbl.getFullSchema()) {
if (column.getDefineExpr() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that this is correctcolumn(a, tmp_c) set(b=f(c), c=b)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that this is correctcolumn(a, tmp_c) set(b=f(c), c=b)

Fix done

@EmmyMiao87
Copy link
Contributor

Is it possible to unify the columns of schema change and materialized view into one logical process in insert stmt?

morningman
morningman previously approved these changes Jun 13, 2020
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* we should add them to the end of targetColumns.
* eg: origin targetColumns: (A,B,C), shadow column: __doris_materialized_view_bitmap_union_C
* after processing, targetColumns: (A, B, C, __doris_materialized_view_bitmap_union_C), and
* origColIdx2MVColumn has 1 element: "3, __doris_materialized_view_bitmap_union_C"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* origColIdx2MVColumn has 1 element: "3, __doris_materialized_view_bitmap_union_C"
* origColIdx2MVColumn has 1 element: "2, __doris_materialized_view_bitmap_union_C"

String origName = ((SlotRef) slots.get(0)).getColumnName();
SlotRef refColumn = column.getRefColumn();
if (refColumn == null) {
ErrorReport.reportAnalysisException(ErrorCode.ERR_BAD_FIELD_ERROR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to show which field is error.

queryStmt.getResultExprs().add(Expr.substituteList(Lists.newArrayList(expr), smap, analyzer, false).get(0));
Expr e = Expr.substituteList(Lists.newArrayList(mvColumn.getDefineExpr()), smap, analyzer, false).get(0);
queryStmt.getResultExprs().add(e);
queryStmt.getBaseTblResultExprs().add(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's different between resultExpr and baseTblResultExpr

Copy link
Contributor

@EmmyMiao87 EmmyMiao87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@EmmyMiao87 EmmyMiao87 added the approved Indicates a PR has been approved by one committer. label Jul 16, 2020
@EmmyMiao87 EmmyMiao87 merged commit de3c4b1 into apache:master Jul 17, 2020
@EmmyMiao87 EmmyMiao87 linked an issue Jul 17, 2020 that may be closed by this pull request
@EmmyMiao87 EmmyMiao87 mentioned this pull request Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/materialized-view Issues or PRs related to materialized view kind/feature Categorizes issue or PR as related to a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Proposal] Materialized View 2.0

4 participants